package com.dyz.leetcode._09_heapAndPriorityQueue;

import java.util.PriorityQueue;

public class JavaHeap {
    public static void main(String[] args) {
        //默认小顶堆
        PriorityQueue<Integer> queue = new PriorityQueue<>();
        //大顶堆
        PriorityQueue<Integer> queue1 = new PriorityQueue<>((a, b)->b-a);

        //堆里添加
        queue.add(2);
        queue.offer(3);

        //删除堆顶元素
        queue.remove();
        queue.poll();

        //拿到堆顶元素
        queue.peek();
    }
}
